package cn.edu.tju.elm.service;

import cn.edu.tju.elm.model.VirtualWallet;
import cn.edu.tju.elm.model.WalletTransaction;
import cn.edu.tju.elm.model.RewardRule;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

public interface VirtualWalletService {
    
    VirtualWallet createWallet(Long userId);
    
    WalletTransaction recharge(Long userId, BigDecimal amount);
    
    WalletTransaction withdraw(Long userId, BigDecimal amount);
    
    WalletTransaction pay(Long userId, BigDecimal amount);
    
    WalletTransaction freeze(Long userId, BigDecimal amount);
    
    WalletTransaction unfreeze(Long userId, Long transactionId);
    
    WalletTransaction payWithCredit(Long userId, BigDecimal amount);
    
    WalletTransaction repayCredit(Long userId, BigDecimal amount);
    
    void setCreditLimit(Long userId, BigDecimal creditLimit);
    
    void setVipStatus(Long userId, boolean isVip, LocalDateTime expireTime);
    
    BigDecimal getBalance(Long userId);
    
    BigDecimal getAvailableBalance(Long userId);
    
    VirtualWallet getWalletByUserId(Long userId);
    
    List<WalletTransaction> getTransactionHistory(Long userId);
    
    List<WalletTransaction> getTransactionHistoryByTimeRange(Long userId, LocalDateTime startTime, LocalDateTime endTime);
    
    RewardRule getCurrentRewardRule();
    
    List<WalletTransaction> transfer(Long fromUserId, Long toUserId, BigDecimal amount, String description);
}